package top.i89ck.modules.routes;

import com.jfinal.config.Routes;
import top.i89ck.common.jqgrid.JqGridInterceptor;
import top.i89ck.modules.admin.DictController;
import top.i89ck.modules.admin.FileController;
import top.i89ck.modules.admin.IndexController;
import top.i89ck.modules.admin.OptionController;
import top.i89ck.modules.admin.RoleController;
import top.i89ck.modules.admin.RouteController;
import top.i89ck.modules.admin.UserController;
import top.i89ck.modules.handler.LoginInterceptor;

/**
 * 系统的路由配置， 用于实现系统管理页面的路由转发
 * @author YINGFU
 *
 */
public class AdminRoute extends Routes{
	
	public final static String BASE_VIEW_PATH = "template/admin";

	@Override
	public void config() {
		setBaseViewPath(BASE_VIEW_PATH);
		addInterceptor(new JqGridInterceptor());
		addInterceptor(new LoginInterceptor());
		/* 配置系统功能级别的路由转发 */
		add("admin", IndexController.class, "/");
		add("admin/route", RouteController.class);
		add("admin/option", OptionController.class, "option");
		add("admin/role", RoleController.class, "role");
		add("admin/user", UserController.class, "user");
		add("admin/dict", DictController.class, "dict");
		add("admin/file", FileController.class);
	}

}
